//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS IdentityStore service.
///
/// The Identity Store service used by IAM Identity Center provides a single place to retrieve all of your identities (users and groups). For more information, see the IAM Identity Center User Guide. This reference guide describes the identity store operations that you can call programmatically and includes detailed information about data types and errors.  IAM Identity Center uses the sso and identitystore API namespaces.
public struct IdentityStore: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the IdentityStore client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            amzTarget: "AWSIdentityStore",
            serviceName: "IdentityStore",
            serviceIdentifier: "identitystore",
            serviceProtocol: .json(version: "1.1"),
            apiVersion: "2020-06-15",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: IdentityStoreErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "us-gov-east-1": "identitystore.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "identitystore.us-gov-west-1.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Creates a group within the specified identity store.
    @Sendable
    @inlinable
    public func createGroup(_ input: CreateGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateGroupResponse {
        try await self.client.execute(
            operation: "CreateGroup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a group within the specified identity store.
    ///
    /// Parameters:
    ///   - description: A string containing the description of the group.
    ///   - displayName: A string containing the name of the group. This value is commonly displayed when the group is referenced. Administrator and AWSAdministrators are reserved names and can't be used for users or groups.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func createGroup(
        description: String? = nil,
        displayName: String? = nil,
        identityStoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateGroupResponse {
        let input = CreateGroupRequest(
            description: description, 
            displayName: displayName, 
            identityStoreId: identityStoreId
        )
        return try await self.createGroup(input, logger: logger)
    }

    /// Creates a relationship between a member and a group. The following identifiers must be specified: GroupId, IdentityStoreId, and MemberId.
    @Sendable
    @inlinable
    public func createGroupMembership(_ input: CreateGroupMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateGroupMembershipResponse {
        try await self.client.execute(
            operation: "CreateGroupMembership", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a relationship between a member and a group. The following identifiers must be specified: GroupId, IdentityStoreId, and MemberId.
    ///
    /// Parameters:
    ///   - groupId: The identifier for a group in the identity store.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - memberId: An object that contains the identifier of a group member. Setting the UserID field to the specific identifier for a user indicates that the user is a member of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func createGroupMembership(
        groupId: String,
        identityStoreId: String,
        memberId: MemberId,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateGroupMembershipResponse {
        let input = CreateGroupMembershipRequest(
            groupId: groupId, 
            identityStoreId: identityStoreId, 
            memberId: memberId
        )
        return try await self.createGroupMembership(input, logger: logger)
    }

    /// Creates a user within the specified identity store.
    @Sendable
    @inlinable
    public func createUser(_ input: CreateUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateUserResponse {
        try await self.client.execute(
            operation: "CreateUser", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a user within the specified identity store.
    ///
    /// Parameters:
    ///   - addresses: A list of Address objects containing addresses associated with the user.
    ///   - displayName: A string containing the name of the user. This value is typically formatted for display when the user is referenced. For example, "John Doe."
    ///   - emails: A list of Email objects containing email addresses associated with the user.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - locale: A string containing the geographical region or location of the user.
    ///   - name: An object containing the name of the user.
    ///   - nickName: A string containing an alternate name for the user.
    ///   - phoneNumbers: A list of PhoneNumber objects containing phone numbers associated with the user.
    ///   - preferredLanguage: A string containing the preferred language of the user. For example, "American English" or "en-us."
    ///   - profileUrl: A string containing a URL that might be associated with the user.
    ///   - timezone: A string containing the time zone of the user.
    ///   - title: A string containing the title of the user. Possible values are left unspecified. The value can vary based on your specific use case.
    ///   - userName: A unique string used to identify the user. The length limit is 128 characters. This value can consist of letters, accented characters, symbols, numbers, and punctuation. This value is specified at the time the user is created and stored as an attribute of the user object in the identity store. Administrator and AWSAdministrators are reserved names and can't be used for users or groups.
    ///   - userType: A string indicating the type of user. Possible values are left unspecified. The value can vary based on your specific use case.
    ///   - logger: Logger use during operation
    @inlinable
    public func createUser(
        addresses: [Address]? = nil,
        displayName: String? = nil,
        emails: [Email]? = nil,
        identityStoreId: String,
        locale: String? = nil,
        name: Name? = nil,
        nickName: String? = nil,
        phoneNumbers: [PhoneNumber]? = nil,
        preferredLanguage: String? = nil,
        profileUrl: String? = nil,
        timezone: String? = nil,
        title: String? = nil,
        userName: String? = nil,
        userType: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateUserResponse {
        let input = CreateUserRequest(
            addresses: addresses, 
            displayName: displayName, 
            emails: emails, 
            identityStoreId: identityStoreId, 
            locale: locale, 
            name: name, 
            nickName: nickName, 
            phoneNumbers: phoneNumbers, 
            preferredLanguage: preferredLanguage, 
            profileUrl: profileUrl, 
            timezone: timezone, 
            title: title, 
            userName: userName, 
            userType: userType
        )
        return try await self.createUser(input, logger: logger)
    }

    /// Delete a group within an identity store given GroupId.
    @Sendable
    @inlinable
    public func deleteGroup(_ input: DeleteGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteGroupResponse {
        try await self.client.execute(
            operation: "DeleteGroup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete a group within an identity store given GroupId.
    ///
    /// Parameters:
    ///   - groupId: The identifier for a group in the identity store.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteGroup(
        groupId: String,
        identityStoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteGroupResponse {
        let input = DeleteGroupRequest(
            groupId: groupId, 
            identityStoreId: identityStoreId
        )
        return try await self.deleteGroup(input, logger: logger)
    }

    /// Delete a membership within a group given MembershipId.
    @Sendable
    @inlinable
    public func deleteGroupMembership(_ input: DeleteGroupMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteGroupMembershipResponse {
        try await self.client.execute(
            operation: "DeleteGroupMembership", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Delete a membership within a group given MembershipId.
    ///
    /// Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - membershipId: The identifier for a GroupMembership in an identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteGroupMembership(
        identityStoreId: String,
        membershipId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteGroupMembershipResponse {
        let input = DeleteGroupMembershipRequest(
            identityStoreId: identityStoreId, 
            membershipId: membershipId
        )
        return try await self.deleteGroupMembership(input, logger: logger)
    }

    /// Deletes a user within an identity store given UserId.
    @Sendable
    @inlinable
    public func deleteUser(_ input: DeleteUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteUserResponse {
        try await self.client.execute(
            operation: "DeleteUser", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes a user within an identity store given UserId.
    ///
    /// Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - userId: The identifier for a user in the identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteUser(
        identityStoreId: String,
        userId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteUserResponse {
        let input = DeleteUserRequest(
            identityStoreId: identityStoreId, 
            userId: userId
        )
        return try await self.deleteUser(input, logger: logger)
    }

    /// Retrieves the group metadata and attributes from GroupId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func describeGroup(_ input: DescribeGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeGroupResponse {
        try await self.client.execute(
            operation: "DescribeGroup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the group metadata and attributes from GroupId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - groupId: The identifier for a group in the identity store.
    ///   - identityStoreId: The globally unique identifier for the identity store, such as d-1234567890. In this example, d- is a fixed prefix, and 1234567890 is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeGroup(
        groupId: String,
        identityStoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeGroupResponse {
        let input = DescribeGroupRequest(
            groupId: groupId, 
            identityStoreId: identityStoreId
        )
        return try await self.describeGroup(input, logger: logger)
    }

    /// Retrieves membership metadata and attributes from MembershipId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func describeGroupMembership(_ input: DescribeGroupMembershipRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeGroupMembershipResponse {
        try await self.client.execute(
            operation: "DescribeGroupMembership", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves membership metadata and attributes from MembershipId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - membershipId: The identifier for a GroupMembership in an identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeGroupMembership(
        identityStoreId: String,
        membershipId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeGroupMembershipResponse {
        let input = DescribeGroupMembershipRequest(
            identityStoreId: identityStoreId, 
            membershipId: membershipId
        )
        return try await self.describeGroupMembership(input, logger: logger)
    }

    /// Retrieves the user metadata and attributes from the UserId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func describeUser(_ input: DescribeUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DescribeUserResponse {
        try await self.client.execute(
            operation: "DescribeUser", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the user metadata and attributes from the UserId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store, such as d-1234567890. In this example, d- is a fixed prefix, and 1234567890 is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.
    ///   - userId: The identifier for a user in the identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func describeUser(
        identityStoreId: String,
        userId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DescribeUserResponse {
        let input = DescribeUserRequest(
            identityStoreId: identityStoreId, 
            userId: userId
        )
        return try await self.describeUser(input, logger: logger)
    }

    /// Retrieves GroupId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func getGroupId(_ input: GetGroupIdRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetGroupIdResponse {
        try await self.client.execute(
            operation: "GetGroupId", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves GroupId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - alternateIdentifier: A unique identifier for a user or group that is not the primary identifier. This value can be an identifier from an external identity provider (IdP) that is associated with the user, the group, or a unique attribute. For the unique attribute, the only valid path is displayName.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func getGroupId(
        alternateIdentifier: AlternateIdentifier,
        identityStoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetGroupIdResponse {
        let input = GetGroupIdRequest(
            alternateIdentifier: alternateIdentifier, 
            identityStoreId: identityStoreId
        )
        return try await self.getGroupId(input, logger: logger)
    }

    /// Retrieves the MembershipId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func getGroupMembershipId(_ input: GetGroupMembershipIdRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetGroupMembershipIdResponse {
        try await self.client.execute(
            operation: "GetGroupMembershipId", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the MembershipId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - groupId: The identifier for a group in the identity store.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - memberId: An object that contains the identifier of a group member. Setting the UserID field to the specific identifier for a user indicates that the user is a member of the group.
    ///   - logger: Logger use during operation
    @inlinable
    public func getGroupMembershipId(
        groupId: String,
        identityStoreId: String,
        memberId: MemberId,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetGroupMembershipIdResponse {
        let input = GetGroupMembershipIdRequest(
            groupId: groupId, 
            identityStoreId: identityStoreId, 
            memberId: memberId
        )
        return try await self.getGroupMembershipId(input, logger: logger)
    }

    /// Retrieves the UserId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func getUserId(_ input: GetUserIdRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetUserIdResponse {
        try await self.client.execute(
            operation: "GetUserId", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the UserId in an identity store.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - alternateIdentifier: A unique identifier for a user or group that is not the primary identifier. This value can be an identifier from an external identity provider (IdP) that is associated with the user, the group, or a unique attribute. For the unique attribute, the only valid paths are userName and emails.value.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func getUserId(
        alternateIdentifier: AlternateIdentifier,
        identityStoreId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetUserIdResponse {
        let input = GetUserIdRequest(
            alternateIdentifier: alternateIdentifier, 
            identityStoreId: identityStoreId
        )
        return try await self.getUserId(input, logger: logger)
    }

    /// Checks the user's membership in all requested groups and returns if the member exists in all queried groups.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func isMemberInGroups(_ input: IsMemberInGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> IsMemberInGroupsResponse {
        try await self.client.execute(
            operation: "IsMemberInGroups", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Checks the user's membership in all requested groups and returns if the member exists in all queried groups.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - groupIds: A list of identifiers for groups in the identity store.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - memberId: An object containing the identifier of a group member.
    ///   - logger: Logger use during operation
    @inlinable
    public func isMemberInGroups(
        groupIds: [String],
        identityStoreId: String,
        memberId: MemberId,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> IsMemberInGroupsResponse {
        let input = IsMemberInGroupsRequest(
            groupIds: groupIds, 
            identityStoreId: identityStoreId, 
            memberId: memberId
        )
        return try await self.isMemberInGroups(input, logger: logger)
    }

    /// For the specified group in the specified identity store, returns the list of all GroupMembership objects and returns results in paginated form.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func listGroupMemberships(_ input: ListGroupMembershipsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGroupMembershipsResponse {
        try await self.client.execute(
            operation: "ListGroupMemberships", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// For the specified group in the specified identity store, returns the list of all GroupMembership objects and returns results in paginated form.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - groupId: The identifier for a group in the identity store.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - maxResults: The maximum number of results to be returned per request. This parameter is used in all List requests to specify how many results to return in one page.
    ///   - nextToken: The pagination token used for the ListUsers, ListGroups and ListGroupMemberships API operations. This value is generated by the identity store service. It is returned in the API response if the total results are more than the size of one page. This token is also returned when it is used in the API request to search for the next page.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGroupMemberships(
        groupId: String,
        identityStoreId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGroupMembershipsResponse {
        let input = ListGroupMembershipsRequest(
            groupId: groupId, 
            identityStoreId: identityStoreId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listGroupMemberships(input, logger: logger)
    }

    /// For the specified member in the specified identity store, returns the list of all GroupMembership objects and returns results in paginated form.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func listGroupMembershipsForMember(_ input: ListGroupMembershipsForMemberRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGroupMembershipsForMemberResponse {
        try await self.client.execute(
            operation: "ListGroupMembershipsForMember", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// For the specified member in the specified identity store, returns the list of all GroupMembership objects and returns results in paginated form.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - maxResults: The maximum number of results to be returned per request. This parameter is used in the ListUsers and ListGroups requests to specify how many results to return in one page. The length limit is 50 characters.
    ///   - memberId: An object that contains the identifier of a group member. Setting the UserID field to the specific identifier for a user indicates that the user is a member of the group.
    ///   - nextToken: The pagination token used for the ListUsers, ListGroups, and ListGroupMemberships API operations. This value is generated by the identity store service. It is returned in the API response if the total results are more than the size of one page. This token is also returned when it is used in the API request to search for the next page.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGroupMembershipsForMember(
        identityStoreId: String,
        maxResults: Int? = nil,
        memberId: MemberId,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGroupMembershipsForMemberResponse {
        let input = ListGroupMembershipsForMemberRequest(
            identityStoreId: identityStoreId, 
            maxResults: maxResults, 
            memberId: memberId, 
            nextToken: nextToken
        )
        return try await self.listGroupMembershipsForMember(input, logger: logger)
    }

    /// Lists all groups in the identity store. Returns a paginated list of complete Group objects.  Filtering for a Group by the DisplayName attribute is deprecated. Instead, use the GetGroupId API action.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func listGroups(_ input: ListGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListGroupsResponse {
        try await self.client.execute(
            operation: "ListGroups", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all groups in the identity store. Returns a paginated list of complete Group objects.  Filtering for a Group by the DisplayName attribute is deprecated. Instead, use the GetGroupId API action.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store, such as d-1234567890. In this example, d- is a fixed prefix, and 1234567890 is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.
    ///   - maxResults: The maximum number of results to be returned per request. This parameter is used in the ListUsers and ListGroups requests to specify how many results to return in one page. The length limit is 50 characters.
    ///   - nextToken: The pagination token used for the ListUsers and ListGroups API operations. This value is generated by the identity store service. It is returned in the API response if the total results are more than the size of one page. This token is also returned when it is used in the API request to search for the next page.
    ///   - logger: Logger use during operation
    @inlinable
    public func listGroups(
        identityStoreId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListGroupsResponse {
        let input = ListGroupsRequest(
            identityStoreId: identityStoreId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listGroups(input, logger: logger)
    }

    /// Lists all users in the identity store. Returns a paginated list of complete User objects.  Filtering for a User by the UserName attribute is deprecated. Instead, use the GetUserId API action.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    @Sendable
    @inlinable
    public func listUsers(_ input: ListUsersRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListUsersResponse {
        try await self.client.execute(
            operation: "ListUsers", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all users in the identity store. Returns a paginated list of complete User objects.  Filtering for a User by the UserName attribute is deprecated. Instead, use the GetUserId API action.  If you have administrator access to a member account, you can use this API from the member account.  Read about member accounts in the  Organizations User Guide.
    ///
    /// Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store, such as d-1234567890. In this example, d- is a fixed prefix, and 1234567890 is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.
    ///   - maxResults: The maximum number of results to be returned per request. This parameter is used in the ListUsers and ListGroups requests to specify how many results to return in one page. The length limit is 50 characters.
    ///   - nextToken: The pagination token used for the ListUsers and ListGroups API operations. This value is generated by the identity store service. It is returned in the API response if the total results are more than the size of one page. This token is also returned when it is used in the API request to search for the next page.
    ///   - logger: Logger use during operation
    @inlinable
    public func listUsers(
        identityStoreId: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListUsersResponse {
        let input = ListUsersRequest(
            identityStoreId: identityStoreId, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listUsers(input, logger: logger)
    }

    /// For the specified group in the specified identity store, updates the group metadata and attributes.
    @Sendable
    @inlinable
    public func updateGroup(_ input: UpdateGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateGroupResponse {
        try await self.client.execute(
            operation: "UpdateGroup", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// For the specified group in the specified identity store, updates the group metadata and attributes.
    ///
    /// Parameters:
    ///   - groupId: The identifier for a group in the identity store.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - operations: A list of AttributeOperation objects to apply to the requested group. These operations might add, replace, or remove an attribute.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateGroup(
        groupId: String,
        identityStoreId: String,
        operations: [AttributeOperation],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateGroupResponse {
        let input = UpdateGroupRequest(
            groupId: groupId, 
            identityStoreId: identityStoreId, 
            operations: operations
        )
        return try await self.updateGroup(input, logger: logger)
    }

    /// For the specified user in the specified identity store, updates the user metadata and attributes.
    @Sendable
    @inlinable
    public func updateUser(_ input: UpdateUserRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateUserResponse {
        try await self.client.execute(
            operation: "UpdateUser", 
            path: "/", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// For the specified user in the specified identity store, updates the user metadata and attributes.
    ///
    /// Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - operations: A list of AttributeOperation objects to apply to the requested user. These operations might add, replace, or remove an attribute.
    ///   - userId: The identifier for a user in the identity store.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateUser(
        identityStoreId: String,
        operations: [AttributeOperation],
        userId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateUserResponse {
        let input = UpdateUserRequest(
            identityStoreId: identityStoreId, 
            operations: operations, 
            userId: userId
        )
        return try await self.updateUser(input, logger: logger)
    }
}

extension IdentityStore {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: IdentityStore, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension IdentityStore {
    /// Return PaginatorSequence for operation ``listGroupMemberships(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupMembershipsPaginator(
        _ input: ListGroupMembershipsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListGroupMembershipsRequest, ListGroupMembershipsResponse> {
        return .init(
            input: input,
            command: self.listGroupMemberships,
            inputKey: \ListGroupMembershipsRequest.nextToken,
            outputKey: \ListGroupMembershipsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listGroupMemberships(_:logger:)``.
    ///
    /// - Parameters:
    ///   - groupId: The identifier for a group in the identity store.
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - maxResults: The maximum number of results to be returned per request. This parameter is used in all List requests to specify how many results to return in one page.
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupMembershipsPaginator(
        groupId: String,
        identityStoreId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListGroupMembershipsRequest, ListGroupMembershipsResponse> {
        let input = ListGroupMembershipsRequest(
            groupId: groupId, 
            identityStoreId: identityStoreId, 
            maxResults: maxResults
        )
        return self.listGroupMembershipsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listGroupMembershipsForMember(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupMembershipsForMemberPaginator(
        _ input: ListGroupMembershipsForMemberRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListGroupMembershipsForMemberRequest, ListGroupMembershipsForMemberResponse> {
        return .init(
            input: input,
            command: self.listGroupMembershipsForMember,
            inputKey: \ListGroupMembershipsForMemberRequest.nextToken,
            outputKey: \ListGroupMembershipsForMemberResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listGroupMembershipsForMember(_:logger:)``.
    ///
    /// - Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store.
    ///   - maxResults: The maximum number of results to be returned per request. This parameter is used in the ListUsers and ListGroups requests to specify how many results to return in one page. The length limit is 50 characters.
    ///   - memberId: An object that contains the identifier of a group member. Setting the UserID field to the specific identifier for a user indicates that the user is a member of the group.
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupMembershipsForMemberPaginator(
        identityStoreId: String,
        maxResults: Int? = nil,
        memberId: MemberId,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListGroupMembershipsForMemberRequest, ListGroupMembershipsForMemberResponse> {
        let input = ListGroupMembershipsForMemberRequest(
            identityStoreId: identityStoreId, 
            maxResults: maxResults, 
            memberId: memberId
        )
        return self.listGroupMembershipsForMemberPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupsPaginator(
        _ input: ListGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListGroupsRequest, ListGroupsResponse> {
        return .init(
            input: input,
            command: self.listGroups,
            inputKey: \ListGroupsRequest.nextToken,
            outputKey: \ListGroupsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store, such as d-1234567890. In this example, d- is a fixed prefix, and 1234567890 is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.
    ///   - maxResults: The maximum number of results to be returned per request. This parameter is used in the ListUsers and ListGroups requests to specify how many results to return in one page. The length limit is 50 characters.
    ///   - logger: Logger used for logging
    @inlinable
    public func listGroupsPaginator(
        identityStoreId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListGroupsRequest, ListGroupsResponse> {
        let input = ListGroupsRequest(
            identityStoreId: identityStoreId, 
            maxResults: maxResults
        )
        return self.listGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listUsers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listUsersPaginator(
        _ input: ListUsersRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListUsersRequest, ListUsersResponse> {
        return .init(
            input: input,
            command: self.listUsers,
            inputKey: \ListUsersRequest.nextToken,
            outputKey: \ListUsersResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listUsers(_:logger:)``.
    ///
    /// - Parameters:
    ///   - identityStoreId: The globally unique identifier for the identity store, such as d-1234567890. In this example, d- is a fixed prefix, and 1234567890 is a randomly generated string that contains numbers and lower case letters. This value is generated at the time that a new identity store is created.
    ///   - maxResults: The maximum number of results to be returned per request. This parameter is used in the ListUsers and ListGroups requests to specify how many results to return in one page. The length limit is 50 characters.
    ///   - logger: Logger used for logging
    @inlinable
    public func listUsersPaginator(
        identityStoreId: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListUsersRequest, ListUsersResponse> {
        let input = ListUsersRequest(
            identityStoreId: identityStoreId, 
            maxResults: maxResults
        )
        return self.listUsersPaginator(input, logger: logger)
    }
}

extension IdentityStore.ListGroupMembershipsForMemberRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IdentityStore.ListGroupMembershipsForMemberRequest {
        return .init(
            identityStoreId: self.identityStoreId,
            maxResults: self.maxResults,
            memberId: self.memberId,
            nextToken: token
        )
    }
}

extension IdentityStore.ListGroupMembershipsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IdentityStore.ListGroupMembershipsRequest {
        return .init(
            groupId: self.groupId,
            identityStoreId: self.identityStoreId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension IdentityStore.ListGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IdentityStore.ListGroupsRequest {
        return .init(
            identityStoreId: self.identityStoreId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension IdentityStore.ListUsersRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> IdentityStore.ListUsersRequest {
        return .init(
            identityStoreId: self.identityStoreId,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
